package com.register;
import java.util.Scanner;
import java.util.regex.Pattern;

public class Name extends Register {
    Scanner sc = new Scanner(System.in);
    @Override

    public void input() {
        System.out.println("输入用户名，要求6-20位字母、数字、下划线组成");
        setStatus(Pattern.matches("^[a-zA-Z]\\w{6,20}$",sc.next()));
        if (!this.isStatus()){
            System.out.println("用户名输入错误请重新输入");
            this.input();
        }
    }
}
